<template>
  <div class="deviceList list">
    <van-sticky>
      <van-nav-bar
        title="设备"
        left-text="返回"
        right-text="按钮"
        left-arrow
        @click-left="goBack"
        @click-right="popupBtn(true)"
      >
        <template #right>
          <i class="icon iconfont icon-a-shezhi" />
        </template>
      </van-nav-bar>
      <van-tabs
        v-model="queryCondition.areaId"
        @click="lot_mark_query_api"
        class="box_shadow_ccc"
      >
        <van-tab
          v-for="(item, areaArrIndex) in queryCondition.areaArr"
          :key="areaArrIndex"
          :title="item.areaName"
          :name="item.areaId"
        />
      </van-tabs>
    </van-sticky>
    <PageSkeleton v-if="listObj.isSkeleton == true" />
    <van-list
      class="padding_16"
      v-if="listObj.isSkeleton == false && listObj.list.length > 0"
      v-model="listObj.loading"
      :finished="listObj.finished"
      finished-text="我也是有底线的"
    >
      <Page-Device-List-Detail
        v-for="(item, listArrIndex) in listObj.list"
        :detailObj="item"
        :key="listArrIndex"
        @detailEmit="detailEmitFn"
      />
    </van-list>
    <Public-Null-Data v-else />
    <van-popup
      close-icon="close"
      v-model="popupObj.show"
      :overlay="popupObj.overlay"
      class="width__70 border_radius_8"
    >
      <div v-if="equipmentObj.specificationCode == 'ON_OFF'">
        <p
          class="text_align_center font_size_16 padding_top_8 padding_bottom_8 border_bottom_1_solid_EEE"
        >
          区域设备控制
        </p>
        <On-Off
          :onText="'区域一键开机'"
          :offText="'区域一键关机'"
          @onEmit="onEmitFn"
          @offEmit="offEmitFn"
        />
      </div>
      <!--单路调光灯-->
      <Public-Error
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'Public-Error'"
        :key="random"
      />
      <!--单路调光灯-->
      <Light-Brt
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'LIGHT_BRT'"
        :key="random"
      />
      <!--插座-->
      <Smart-Socket
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'SMART_SOCKET'"
        :key="random"
      />
      <!--人体红外感应器-->
      <In-Sen-Sor
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'INSENSOR'"
        :key="random"
      />
      <!--光照传感器-->
      <Ill-Min
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'ILLUMIN'"
        :key="random"
      />
      <!--窗帘控制器-->
      <Cur-Tain
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'CURTAIN'"
        :key="random"
      />
      <!--RGB调光灯-->
      <Light-Rgb
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'LIGHT_RGB'"
        :key="random"
      />
      <!--烟雾报警器-->
      <Smoke
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'SMOKE'"
        :key="random"
      />
      <!--场景开关-->
      <Spanel
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'SPANEL'"
        :key="random"
      />
      <!--空调-->
      <AirCd
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'AIR_CD'"
        :key="random"
      />
      <!--温湿度传感器-->
      <M2-Air-Sen-Sor
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'M2AIRSENSOR'"
        :key="random"
      />
      <!--PM2.5传感器-->
      <Pm2p5
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'pm2p5'"
        :key="random"
      />
      <!--PM10传感器-->
      <Pm10
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'PM10'"
        :key="random"
      />
      <!--甲醛传感器-->
      <HcHo
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'HCHO'"
        :key="random"
      />
      <!--有机挥发物传感器-->
      <Voc
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'VOC'"
        :key="random"
      />
      <!--CO2传感器-->
      <Co2
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'CO2'"
        :key="random"
      />
      <!--温度传感器-->
      <Tem-Pera-Ture
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'TEMPERATURE'"
        :key="random"
      />
      <!--湿度传感器-->
      <HumiDity
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'HUMIDITY'"
        :key="random"
      />
      <!--混合传感器-->
      <M7AirSenSor
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'M7SENSOR'"
        :key="random"
      />
      <!--电控锁-->
      <ElectricLock
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'ELECTRIC_LOCK'"
        :key="random"
      />
      <!--IP广播-->
      <Ipb
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'IPB'"
        :key="random"
      />
      <!--智能空开-->
      <Air-Controller
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'AIR_CONTROLLER'"
        :key="random"
      />
      <!--排队机-->
      <Acd-Machine
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'ACD_MACHINE'"
        :key="random"
      />
      <!--广告机-->
      <Ad-Machine
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'AD_MACHINE'"
        :key="random"
      />
      <!--开关-->
      <Switch-Device
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'SWITCH'"
        :key="random"
      />
      <!--色温灯-->
      <Light-Temp
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'LIGHT_TEMP'"
        :key="random"
      />
      <!--边缘主机-->
      <Edge-Host
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'edge_host'"
        :key="random"
      />
      <!--转发器-->
      <Repe-Ater
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == 'REPEATER'"
        :key="random"
      />
      <!--4k控制器-->
      <Four-KPING
        :obj="equipmentObj"
        v-else-if="equipmentObj.specificationCode == '4KPING'"
        :key="random"
      />
      <!--移动插座-->
      <Mobile-Esocket
          :obj="equipmentObj"
          v-else-if="equipmentObj.specificationCode == 'MOBILESOCKET'"
          :key="random"
      />
      <!--没有匹配上显示空组件-->
      <PublicNullData v-else :key="random" />
    </van-popup>
  </div>
</template>
<script src="./deviceList.js" />
